﻿module Sustainalytics.Portfolio {
    export class PortfolioDetailsDto {
        public companyId: string;
        public portfolioId: string;
        public id: string;
        public companyNameUrlFriendly: string;
        public sharingStatus: number;
        public securityId: number;
        public securityWeight: number;
        public displayInfo: DisplayInformationDto;
        public matchedInfo: MatchedInformationDto;
        public isAccesible:boolean;
    }

    export class PortfolioValidMatchesDto {
        public companyId: string;
        public portfolioId: string;
        public id: string;
        public companyNameUrlFriendly: string;
        public sharingStatus: number;
        public securityId: number;
        public securityWeight: number;
        public displayInfo: DisplayInformationDto;
        public matchedInfo: MatchedInformationDto[];
        public isAccesible: boolean;
        public matchType: PortfolioMatchType;
    }

    export class PortfolioInvalidMatchesDto {
        public companyId: string;
        public portfolioId: string;
        public id: string;
        public companyNameUrlFriendly: string;
        public sharingStatus: number;
        public securityId: number;
        public securityWeight: number;
        public displayInfo: DisplayInformationDto;
        public matchedInfo: MatchedInformationDto[];
        public isAccesible: boolean;
    }

    export class DisplayInformationDto {
        public securityIdentifier: string;
        public customSecurityIdentifierName: string;
        public accessDetails:string;
    }

    export class MatchedInformationDto {
        public capitalIQId: number;
        public companyName: string;
        public portfolioMatchId: string;
    }

    export class UnmatchedInformationDto {
        public capitalIQId: number;
        public companyName: string;
        public portfolioMatchId: string;
        public matchType: PortfolioMatchType;
    }

    export class PortfolioResultstDto {
        public portfolioDetails: PortfolioDetailsDto[];
        public count:number;
    }

    export enum PortfolioMatchType {
        NoMatch = 0,
        ExactMatch = 1,
        SecuritiesMatchSameCompany = 2,
        SecuritiesMatchDifferentCompanies = 3,
        CompanyHasNoSecurity = 4,
        CompanyHasNoValidSecurity = 5,
        CompanyLevelSecurity = 6,
        NoAccess = 7
    }
}
